package com.bbcare.cp.plat.store.ibatis.sms;

import java.util.List;
import java.util.Map;

import com.bbcare.cp.plat.entity.sms.PtSmsCurrent;
import com.bbcare.cp.plat.entity.sms.PtSmsRd;


/**
 * @name: 短信记录流水表存储接口
 * @author: DemonLee
 * @createTime: 2017.5.27
 * @description: 短信记录
 * @modify:
 * 
 */
public interface ISmsRdDao {
    /**
     * 根据taskId一定时间范围内是否已经发送过短信
     * 
     * @param
     * @return int
     */
    int countSmsRdByCondition(Map<String, Object> paramMap) throws Exception;
   
    /**
     * 根据ptSchemeId一定时间范围内是否已经发送过短信
     * 
     * @param
     * @return int
     */
    int countSmsRdByPtSchemeId(Map<String, Object> paramMap) throws Exception;

    /**
     * 插入短信发送记录
     * 
     * @param
     * @return int
     */
    int savePtSmsRd(List<PtSmsRd> smsRd) throws Exception;

    /**
     * 将短信置为待验证
     * 
     * @param
     * @return
     */
    public void sendSuccRegSms(Map<String, Object> paramMap) throws Exception;

    /**
     * 短信发送失败将其置为失效
     * 
     * @param
     * @return
     */
    public void sendFailSms(Map<String, Object> paramMap) throws Exception;

    /**
     * 将上一次的短信置为失效
     * 
     * @param
     * @return
     */
    public void failureUserRegSms(PtSmsRd smsRd) throws Exception;

    /**
     * 校验验证码
     * 
     * @param
     * @return
     */
    public List<Map<String, Object>> selectVerifyCode(Map<String, Object> paramMap) throws Exception;

    /**
     * 校验成功后置为失效
     * 
     * @param
     * @return
     */
    public void updateSms(Map<String, Object> map) throws Exception;

    /**
     * 插入短信发送记录
     * 
     * @param
     * @return int
     */
    public int querySmsCountByNowDayMpSmsType(Map<String, Object> map) throws Exception;

    /**
     * 插入短信发送记录
     * 
     * @param
     * @return List
     */
    public List<Map<String, Object>> getLastSms(Map<String, Object> map) throws Exception;
    
    /**
     * 插入短信实时发送 中间表
     * 
     * @param pt_sms_current
     * @return int
     */
    int savePtSmsCurrent(PtSmsCurrent smsRd) throws Exception;

    /**
     * 最近发送成功的短信 根据随访时间规则查询
     * @param paramMap
     * @return
     * @throws Exception
     */
    int countSmsHisdByFollowTime(Map<String, Object> paramMap) throws Exception;
    
    //根据taskId一定时间范围内是否已经发送过 规则短信
    int countSmsRdByPtSchemeIdAge(Map<String, Object> paramMap) throws Exception;
    
    //根据ptSchemeId一定时间范围内是否已经发送过 规则短信
    int countSmsRdByConditionNew(Map<String, Object> paramMap) throws Exception;
    
	/**查询微信发送记录*/
	List<Map<String,Object>> selectWechatMsgList(Map<String, Object> mapIn) throws Exception;
	
	/**查询微信发送记录总数*/
	int selectWechatMsgListCount(Map<String, Object> mapIn) throws Exception;
	
}
